/********** Loop which draws into alternate bitmaps and swaps view *********/
for(j=200; j<440; j++)
{
if(j%2) /* Odd cases --- Draw to RP1 */
{
ShowView(1);
if(j-2) DrawFigure(RP[0],j-2,2); /* Clear previous version */
DrawFigure(RP[0],j,1); /* Draw this version */
}
else /* Even cases --- Draw to RP2 */
{
ShowView(0);
if(j-2 >= 0) DrawFigure(RP[1],j-2,0); /* Clear previous version */
DrawFigure(RP[1],j,1); /* Draw this version */
}
// Delay(1);
}
#ifdef FASTNBUFF
puts("\nWhat you just saw was fast, Intuition-unfriendly double-buffered\nanimation, rapidly switching between 2 views having different\nbackground colors.\n");
#else
puts("\nWhat you just saw was double-buffered animation, rapidly switching\nbetween two views having different background colors.\n");
#endif
CRAPOUT:
if (RP[1]) FreeNBuff(screen, DEPTH, RP[1], 1); // deallocate extra buffer
if (RP[0]) FreeNBuff(screen, DEPTH, RP[0], 0); // needed for general cleanup